<template>
  <van-tabbar v-model="active"  @change="btn">
    <van-tabbar-item icon="home-o">单词</van-tabbar-item>
    <van-tabbar-item icon="search">学习</van-tabbar-item>
    <van-tabbar-item icon="friends-o">一起背</van-tabbar-item>
    <van-tabbar-item icon="stop-circle-o">铜板购物</van-tabbar-item>
    <van-tabbar-item icon="contact-o">我的</van-tabbar-item>
  </van-tabbar>
</template>

<script>
import { ref } from "vue";

export default {
  data() {
    return {
      active: this.ishow,
    };
  },
  methods: {
    btn(index) {
      console.log(index);
      if(index==0){
        this.$router.push('/')
      }
      if(index==1){
        this.$router.push('/studys')
      }
      if(index==2){
        this.$router.push('/allbei')
      }
      if(index==3){
        this.$router.push('/tonggou')
      }
      if(index==4){
        this.$router.push('/my')
      }
    },
  },
  components: {
    ref,
  },
  props: ["ishow"],
};
</script>

<style>

</style>
